<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2010 XBRL International. All Rights Reserved. -->
<?xml-stylesheet type="text/xsl" href="../stylesheets/conformanceFunction.xsl"?>
<testcase
  xmlns="http://xbrl.org/2008/conformance"
  xmlns:reg="http://xbrl.org/2008/registry"
  xmlns:fn="http://www.w3.org/2005/xpath-functions"
  xmlns:fcn="http://xbrl.org/2008/function"
  xmlns:cfcn="http://xbrl.org/2008/conformance/function"
  xmlns:xbrli="http://www.xbrl.org/2003/instance"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xfi="http://www.xbrl.org/2008/function/instance"
  xmlns:xfie="http://www.xbrl.org/2008/function/instance/error"
  xmlns:xqt-err="http://www.w3.org/2005/xqt-errors"
  xmlns:concept="http://xbrl.org/formula/conformance/example" 
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="
  http://xbrl.org/2008/registry ../schemas/registry.xsd
  http://xbrl.org/2008/function ../schemas/function.xsd
  http://xbrl.org/2008/conformance ../schemas/conformance.xsd
  http://xbrl.org/2008/conformance/function ../schemas/conformanceFunction.xsd
  ">
  <owners>
    <reg:owner id="geoff">
      <reg:name>Geoff Shuetrim</reg:name>
      <reg:affiliation>Galexy</reg:affiliation>
      <reg:email>geoff@galexy.net</reg:email>
     <reg:assumedOwnership moment="2008-01-30T00:00:00" />
    </reg:owner>    <reg:owner id="herm">      <reg:name>Herm Fischer</reg:name>      <reg:affiliation>UBMatrix / Mark V Systems</reg:affiliation>      <reg:email>fischer@markv.com</reg:email>     <reg:assumedOwnership moment="2010-01-31T16:55:00" />    </reg:owner>
    <reg:owner id="david">      <reg:name>David North</reg:name>      <reg:affiliation>CoreFiling</reg:affiliation>      <reg:email>dtn@corefiling.com</reg:email>     <reg:assumedOwnership moment="2011-08-05T17:16:20" />    </reg:owner>  </owners>

  <number>90201</number>

  <name>All tests</name>

  <documentation>
    <xhtml:p>
      This is only a template.  It needs to be updated.
    </xhtml:p>
  </documentation>

  <variation id="V-01">
    <name>Works for a credit concept.</name>
    <documentation>
      <xhtml:p>
        Tests that the function works for a credit concept.
      </xhtml:p>
     </documentation>
    <inputs>
      <schema xlink:type="simple" xlink:href="balance.xsd"/>
      <instance readMeFirst="true" id="V01" xlink:type="simple" xlink:href="instance.xml"/>
      <cfcn:call file="V01">
        xfi:concept-balance(fn:node-name(/xbrli:xbrl/concept:c1[1]))
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count( $result ) eq 1            and
         $result eq 'credit'
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-02">
    <name>Works for a debit concept.</name>
    <documentation>
      <xhtml:p>
        Tests that the function works for a debit concept.
      </xhtml:p>
     </documentation>
    <inputs>
      <schema xlink:type="simple" xlink:href="balance.xsd"/>
      <instance readMeFirst="true" id="V02" xlink:type="simple" xlink:href="instance.xml"/>
      <cfcn:call file="V02">
        xfi:concept-balance(fn:node-name(/xbrli:xbrl/concept:c2[1]))
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count( $result ) eq 1
            and
         $result eq 'debit'
      </cfcn:test>
    </outputs>
  </variation>

  <variation id="V-03">
    <name>Works for an unclassified concept.</name>
    <documentation>
      <xhtml:p>
        Tests that the function works for an unclassified concept.
      </xhtml:p>
     </documentation>
    <inputs>
      <schema xlink:type="simple" xlink:href="balance.xsd"/>
      <instance readMeFirst="true" id="V03" xlink:type="simple" xlink:href="instance.xml"/>
      <cfcn:call file="V03">
        xfi:concept-balance(fn:node-name(/xbrli:xbrl/concept:c3[1]))
      </cfcn:call>
    </inputs>
    <outputs>
      <cfcn:test>
         count( $result ) eq 1
            and
         $result eq ''
      </cfcn:test>
    </outputs>
  </variation>   <variation id="V-04">    <name>Non-concept QName passed to function should raise an error.</name>    <documentation>      <xhtml:p>        Function-specified error for non-concept QName.      </xhtml:p>    </documentation>    <inputs>      <schema xlink:type="simple" xlink:href="balance.xsd"/>      <instance readMeFirst="true" id="V04" xlink:type="simple" xlink:href="instance.xml"/>      <cfcn:call file="V04">        xfi:concept-balance(fn:node-name(/xbrli:xbrl))      </cfcn:call>    </inputs>    <outputs>      <error>xfie:invalidConceptQName</error>    </outputs>  </variation>   <variation id="V-05">    <name>Wrong node to function</name>    <documentation>      <xhtml:p>        XPath-defined error for node type incorrect.      </xhtml:p>    </documentation>    <inputs>      <schema xlink:type="simple" xlink:href="balance.xsd"/>      <instance readMeFirst="true" id="V05" xlink:type="simple" xlink:href="instance.xml"/>      <cfcn:call file="V05">        xfi:concept-balance(/xbrli:xbrl)      </cfcn:call>    </inputs>    <outputs>      <error>xqt-err:XPTY0004</error>    </outputs>  </variation>  

  <revisions>
    <reg:revision on="2008-02-04T14:30:00" by="geoff">
      <xhtml:p>
        Created the test case.
      </xhtml:p>
    </reg:revision>
    <reg:revision on="2010-01-31T16:55:00" by="herm">
      <xhtml:p>
        Fixed indexes [0] to be [1] above per IHR.  Changed schemaRef in instance to balance.xsd.
      </xhtml:p>
    </reg:revision>
    <reg:revision on="2010-02-04T08:00:00" by="herm">
      <xhtml:p>
        Fixed namespaces, calls, and outputs, per e-mail from Muramoto-san.
      </xhtml:p>
    </reg:revision>
    <reg:revision on="2010-09-11T00:00:00" by="herm">
      <xhtml:p>
        Corrected test case instances which were missing decimals on numeric facts.
      </xhtml:p>
    </reg:revision>    <reg:revision on="2010-09-11T00:00:00" by="david">      <xhtml:p>        Added variations for error cases (wrong argument type and a non-concept QName being passed).      </xhtml:p>    </reg:revision>
  </revisions>

</testcase>
